#include <bits/stdc++.h>
using namespace std;
int a[50];
int ans = 0;
int n;
void search(int depth, int sum) {
  if (depth > n) {
    if (sum == 0)
      ans++;
    return;
  }
  search(depth + 1, sum);
  search(depth + 1, sum + a[depth]);
}
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
  }
  search(1, 0);
  cout << ans;

  return 0;
}